package zjt.string1;

import java.util.Arrays;

public class demo2 {
    public static void main(String[] args) {
        String s = "a";
        String s1 = "B";
        //判断是否相等
        System.out.println(s.compareTo(s1));
        System.out.println("________");
        //忽略大小判断
        System.out.println(s.compareToIgnoreCase(s1) );
        System.out.println("________");
        //以什么开头 startsWith(String prefix, int toffset)
        String s2 = "sfagdf";
        boolean s3 = s2.startsWith("s", 0);
        System.out.println(s3);
        System.out.println("________");
        boolean f =s2.endsWith("f");
        System.out.println(f);
        String s4 = "sf";
        System.out.println(s2.contains(s4));
        String s5 = s4.toUpperCase();
        String s6 = s4.toLowerCase();
        char[] chars = s4.toCharArray();
        byte[] bytes = s4.getBytes();
        String substring = s2.substring(0, 2);
        System.out.println("___");
        String r6 ="123451" ;
        int i = s2.indexOf("a");

        int i2 = r6.indexOf(49,2);
        System.out.println(i2);
        String[] split = r6.split("2", 2);
        System.out.println(Arrays.toString(split));
    }
}
